Skip to content

refactor(pxe): skip storage reads for never-updated contracts#23131

Open
nchamo wants to merge 2 commits intomerge-train/fairiesfrom
nchamo/read-tree-short-circuit
Open

refactor(pxe): skip storage reads for never-updated contracts#23131
nchamo wants to merge 2 commits intomerge-train/fairiesfrom
nchamo/read-tree-short-circuit

Conversation

@nchamo
Copy link
Copy Markdown
Contributor

@nchamo nchamo commented May 9, 2026

Summary

  • getUpdatedClassIdHints previously always called DelayedPublicMutableValues.readFromTree, which triggers multiple getPublicStorageAt RPC calls. The vast majority of contracts are never updated, so these reads return empty values.
  • Use the getPublicDataWitness result we already fetch: in an indexed merkle tree, a non-matching leaf.slot means the slot has never been written, so we can skip the reads and return DelayedPublicMutableValues.empty(...) directly.
  • Adds a unit test covering both the short-circuit and the read path. e2e_contract_updates.test.ts exercises both cases end-to-end (before and after a contract class update).

@nchamo nchamo self-assigned this May 9, 2026
@nchamo nchamo added ci-full Run all master checks. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure and removed ci-full Run all master checks. labels May 9, 2026
@nchamo nchamo requested a review from benesjan May 10, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant